<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>

<script
	src="${contextPath}/resources/common/js/jquery.validate.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="screen"
	href="${contextPath}/resources/common/css/errorform.css" />
<link rel="stylesheet" type="text/css" media="screen" href="${contextPath}/resources/templets/amaze/css/viewBigImage.css" />
<script type="text/javascript" src="${contextPath}/resources/templets/amaze/js/viewBigImage.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		jQuery("#form1").validate({
			rules : {
				icpInfo : "required",
				logo : "required",
				shopName : "required",
				url : "required",
				supportMail : {
					required : true,
					checkEmail : true
				},
				internationalCode:"digits",
				areaCode:"digits",
				telephone:"digits"
			},
			messages : {
				icpInfo : "请输入icpInfo",
				logo : "请输入logo",
				shopName : "请输入shopName",
				url : "请输入url",
				supportMail : {
					required : "请输入supportMail",
					checkEmail : "您输入的多个邮箱中有邮箱格式不正确，请重新核对后再输入!"
				},
				internationalCode:"输入数字",
				areaCode:"输入数字",
				telephone:"输入数字"
			}
		});

		//斑马条纹
		$("#col1 tr:nth-child(even)").addClass("even");
	});
	
	jQuery.validator.addMethod("checkEmail", function(value, element) {
		var reg = /^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/;
		var emails = value.split(",");
		if(emails.length > 0){
			for(var i = 0; i < emails.length; i++){
				var email = emails[i];
				if(isBlank(email)){
					return false;
				}else if(!reg.test(email)){
					return false;
				}
			}
			return true;
		}else{
			return reg.test(value);
		}
    }, "您输入的多个邮箱中有邮箱格式不正确，请重新核对后再输入!"); 
    
    function isBlank(value){
    	return value == undefined || value == null || $.trim(value) === "";
    }
</script>

<table class="${tableclass}" style="width: 100%">
	<thead>
		<tr>
			<th><strong class="am-text-primary am-text-lg">系统管理</strong> /
				全局配置</th>
		</tr>
	</thead>
</table>

<form:form  action="${contextPath}/admin/system/systemConfig/save" method="post" id="form1" enctype="multipart/form-data">
	<input id="id" name="id" value="${systemConfig.id}" type="hidden">
	<div align="center">
		<%@ include file="/WEB-INF/pages/common/messages.jsp"%>
		<table border="0" align="center" class="${tableclass}" id="col1"
			style="width: 100%">

			<tr>
				<td style="width: 30%">
					<div align="center">
						icp信息 <font color="ff0000">*</font>
					</div></td>
				<td><input type="text" name="icpInfo" id="icpInfo"
					value="${systemConfig.icpInfo}" class="${inputclass}"
					style="width: 50%" /></td>
			</tr>
			<tr>
				<td>
					<div align="center">
						商城名称 <font color="ff0000">*</font>
					</div></td>
				<td><input type="text" name="shopName" id="shopName"
					value="${systemConfig.shopName}" class="${inputclass}"
					style="width: 50%" /></td>
			</tr>
			<tr>
				<td>
					<div align="center">
						商城域名 <font color="ff0000">*</font>
					</div></td>
				<td><input type="text" name="url" id="url"
					value="${systemConfig.url}" class="${inputclass}"
					style="width: 50%" /></td>
			</tr>
			<tr>
				<td>
					<div align="center">
						支持邮箱 <font color="ff0000">*</font>
					</div></td>
				<td><input type="text" name="supportMail" id="supportMail"
					value="${systemConfig.supportMail}" class="${inputclass}"
					style="width: 50%" />&nbsp;&nbsp;&nbsp;多个请用英文逗号隔开</td>
			</tr>
			<tr>
				<td>
					<div align="center">
						联系方式 <font color="ff0000"></font>
					</div></td>
				<td><font>+</font> 
				<input type="text" name="internationalCode" value="${systemConfig.internationalCode}" class="${inputclass}" style="width: 50px" maxlength="5" /> 
				<input type="text" name="areaCode" value="${systemConfig.areaCode}" class="${inputclass}" style="width: 50px" maxlength="5" /> 
				<input type="text" name="telephone" id="telephone" value="${systemConfig.telephone}" class="${inputclass}" maxlength="20" /> 
				<font>国际电话号码的正确写法：国家代码+地区代码(区号)+电话号码</font></td>
			</tr>
			<tr>
				<td>
					<div align="center">
						支持QQ号码
					</div></td>
				<td>
					<input type="text" name="qqNumber" id="qqNumber"
					value="${systemConfig.qqNumber}" class="${inputclass}"
					style="width: 50%" />&nbsp;&nbsp;&nbsp;多个请用英文逗号隔开
				</td>
			</tr>
			<tr>
				<td>
					<div align="center">
						微信订阅号二维码(大小600*600) <font color="ff0000"></font>
					</div></td>
				<td>
					<input type="file" name="wechatCodeFile" id="wechatCodeFile" /> 
					<c:if test="${wechatCodeVO.wechatOrderCode!=null}">
						<div class="zoombox">
								<span class="photoBox">
									<div class="loadingBox">
										<span class="loading"></span>
									</div>
									<img src="<ls:photo item='${wechatCodeVO.wechatOrderCode}'/>" class="zoom" onclick="zoom_image($(this).parent());" style="max-height: 100px;max-width: 150px;">
								</span>
								
								<div class="photoArea" style="display:none;">
									<p><img src="about:blank" class="minifier" onclick="zoom_image($(this).parent().parent());"/></p>
										<p class="toolBar gc">
										<span><a class="green" href="javascript:void(0)" onclick="zoom_image($(this).parent().parent().parent());">收起</a></span>|<span class="view"><a class="green" href="<ls:photo item='${wechatCodeVO.wechatOrderCode}'/>" target="_blank">查看原图</a></span>
										</p>
								</div>
							</div>
					</c:if>
					</td>
			</tr>
			<tr>
				<td>
					<div align="center">
						微信服务号二维码(大小600*600) <font color="ff0000"></font>
					</div></td>
				<td>
					<input type="file" name="wechatServiceCodeFile" id="wechatServiceCodeFile" />
					<input type="hidden" name="wechatCode"  id="wechatCode" value='${systemConfig.wechatCode}'/>
					<c:if test="${wechatCodeVO.wechatServiceCode!=null}">
						<div class="zoombox">
								<span class="photoBox">
									<div class="loadingBox">
										<span class="loading"></span>
									</div>
									<img src="<ls:photo item='${wechatCodeVO.wechatServiceCode}'/>" class="zoom" onclick="zoom_image($(this).parent());" style="max-height: 100px;max-width: 150px;">
								</span>
								
								<div class="photoArea" style="display:none;">
									<p><img src="about:blank" class="minifier" onclick="zoom_image($(this).parent().parent());"/></p>
										<p class="toolBar gc">
										<span><a class="green" href="javascript:void(0)" onclick="zoom_image($(this).parent().parent().parent());">收起</a></span>|<span class="view"><a class="green" href="<ls:photo item='${wechatCodeVO.wechatServiceCode}'/>" target="_blank">查看原图</a></span>
										</p>
								</div>
							</div>
					</c:if>
					</td>
			</tr>
			<tr>
				<td>
					<div align="center">
						微信头条 <font color="ff0000"></font>
					</div></td>
				<td><input type="file" name="wechatTitlePicFile" id="wechatTitlePicFile" /> 
				     <input type="hidden" name="wechatTitlePic" id="wechatTitlePic" value="${systemConfig.wechatTitlePic}"  />
					
					<c:if test="${systemConfig.wechatTitlePic!=null}">
						<div class="zoombox">
								<span class="photoBox">
									<div class="loadingBox">
										<span class="loading"></span>
									</div>
									<img src="<ls:photo item='${systemConfig.wechatTitlePic}'/>" class="zoom" onclick="zoom_image($(this).parent());" style="max-height: 100px;max-width: 150px;">
								</span>
								
								<div class="photoArea" style="display:none;">
									<p><img src="about:blank" class="minifier" onclick="zoom_image($(this).parent().parent());"/></p>
										<p class="toolBar gc">
										<span><a class="green" href="javascript:void(0)" onclick="zoom_image($(this).parent().parent().parent());">收起</a></span>|<span class="view"><a class="green" href="<ls:photo item='${systemConfig.wechatTitlePic}'/>" target="_blank">查看原图</a></span>
										</p>
								</div>
							</div>
					</c:if>
					</td>
			</tr>
			<tr>
				<td>
					<div align="center">
						Logo标识(大小315*90) <font color="ff0000">*</font>
					</div></td>
				<td><input type="file" name="file" id="file" /> <input
					type="hidden" name="logo" id="logo" value="${systemConfig.logo}"
					class="${inputclass}" style="width: 50%" />
					
					<c:if test="${systemConfig.logo!=null}">
						<div class="zoombox">
								<span class="photoBox">
									<div class="loadingBox">
										<span class="loading"></span>
									</div>
									<img src="<ls:photo item='${systemConfig.logo}'/>" class="zoom" onclick="zoom_image($(this).parent());" style="max-height: 100px;max-width: 150px;">
								</span>
								
								<div class="photoArea" style="display:none;">
									<p><img src="about:blank" class="minifier" onclick="zoom_image($(this).parent().parent());"/></p>
										<p class="toolBar gc">
										<span><a class="green" href="javascript:void(0)" onclick="zoom_image($(this).parent().parent().parent());">收起</a></span>|<span class="view"><a class="green" href="<ls:photo item='${systemConfig.logo}'/>" target="_blank">查看原图</a></span>
										</p>
								</div>
							</div>
					</c:if>
					</td>
			</tr>
			
			<tr>
				<td>
					<div align="center">
						SEO标题
					</div></td>
				<td>
				  <textarea cols="77" rows="8" maxlength="200"   class="${inputclass}" name="title" class="text-input" id="title">${systemConfig.title}</textarea>
				</td>
			</tr>
			
			
			<tr>
				<td>
					<div align="center">
						SEO关键字
					</div></td>
				<td>
				  <textarea cols="77" rows="8" maxlength="200"   class="${inputclass}" name="keywords" class="text-input" id="keywords">${systemConfig.keywords}</textarea>
				</td>
			</tr>
			
			<tr>
				<td>
					<div align="center">
						SEO描述
					</div></td>
				<td>
				 <textarea cols="77" rows="8" maxlength="200"   class="${inputclass}" name="description" class="text-input" id="description">${systemConfig.description}</textarea>
				</td>
			</tr>
			
			
			<tr>
				<td colspan="2">
					<div align="center">
						<input type="submit" value="提交" class="${btnclass}" /> <input
							type="reset" value="重置" class="${btnclass}" />
					</div></td>
			</tr>
		</table>
	</div>
</form:form>


